package com.sali.b_design_pattern.e_template_pattern.lesson_abstract_class;

/**
 * @description:
 * @author: zhang hang
 * @date: 2023/3/20 20:30.
 * @version: 1.0
 */
public abstract class CourseTemplate {

    public void createCourse() {
        designContent();
        prepareContent();
        checkError();
        recordVideo();
        if (needHomeWork()) {
            checkHomeWork();
        }
    }


    private void designContent() {
        System.out.println("设定设计模式的内容");
    }

    private void prepareContent() {
        System.out.println("开始准备课件");
    }

    private void checkError() {
        System.out.println("开始筛查是否有问题");
    }

    private void recordVideo() {
        System.out.println("开始录制");
        System.out.println("录制完毕开始剪辑");
        System.out.println("剪辑完毕开始上传");
    }

    /**
     * description: 这个方法可让子类覆盖
     **/
    protected boolean needHomeWork() {
        return false;
    }

    /**
     * description: 检查作业->一定让子类去重写和覆盖的方法
     **/
    abstract void checkHomeWork();

}
